<%@ tag body-content="empty" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="r" uri="http://www.groupwareworkbench.org.br/taglibs/reflection" %>
<%@ taglib prefix="tag" uri="http://www.groupwareworkbench.org.br/widgets/tag" %>
<%@ taglib prefix="recommend" uri="http://www.groupwareworkbench.org.br/widgets/recommend" %>

<%@ attribute name="entity" required="true" rtexprvalue="true" type="java.lang.Object" %>
<%@ attribute name="recommendMgr" required="true" rtexprvalue="true" type="br.org.groupwareworkbench.collablet.coop.recommend.RecommendMgrInstance" %>

<r:callMethod methodName="getRelated" instance="${recommendMgr}" var="recommendItems" >
    <r:param type="java.lang.Object" value="${entity}" />
</r:callMethod>

<div class="simple_list">
    <h1>Relacionados:</h1>
    <ul>
        <c:forEach items="${recommendItems}" var="recommend" >
            <li>
                <r:callMethod methodName="formatEntityURL" instance="${entity.collablet}" var="entityUrl">
                    <r:param type="java.lang.Object" value="${recommend.destination}" />
                </r:callMethod>
                <c:if test="${not empty entityUrl}">
                    <a href="<c:url value="${entityUrl}" />" ><c:out value="${recommend.destination.title}" /></a>,
                    Similaridade: <c:out value="${recommend.similarity}" />
                </c:if>
            </li>
        </c:forEach>
    </ul>
</div>
